<?php 
namespace app\admin\controller;
use think\Controller;

	class Base extends Controller
	{

		public function initialize(){
			if(session("uid") !== null){
				$role = model("admin")->where("admin_id",session("uid"))->select();
				$menu = model("SystemModule")->getAllMenu('menu');
				if(session("uid") != 1){
					$menu['allper']=model('Access')->getAllPer($role[0]['role_id']);

				}else{
					$allper=model('SystemModule')->field("mod_id")->select();
					
					for($i=0;$i<count($allper);$i++){
						$menu['allper'][$i]=$allper[$i]['mod_id'];
					}
				}
				
				$this->assign($menu);
			}
			
		}
	}